import request from '@/config/axios'

// 查询菜单（精简）列表
export const getSimpleMenusList = () => {
  return request.get({ url: '/menuManage/getMenus' })
}

// 查询菜单列表
export const getMenuList = (params) => {
  return request.get({ url: '/menuManage/formList', params })
}

// 获取菜单详情
export const getMenu = (id: number) => {
  return request.get({ url: '/menuManage/getMenuById?id=' + id })
}

// 新增菜单
export const createMenu = (data) => {
  return request.post({ url: '/menuManage/addMenu', data })
}

// 修改菜单
export const updateMenu = (data) => {
  return request.post({ url: '/menuManage/editMenu', data })
}

// 删除菜单
export const deleteMenu = (id: number) => {
  return request.delete({ url: '/menuManage/deleteMenuById?id=' + id })
}

// 查询Banner列表
export const getBannerList = (params) => {
  return request.get({ url: '/bannerManage/formList', params })
}

// 获取Banner详情
export const getBanner = (id: number) => {
  return request.get({ url: '/bannerManage/getBannerById?id=' + id })
}

// 新增Banner
export const createBanner = (data) => {
  return request.post({ url: '/bannerManage/addBanner', data, headersType: 'multipart/form-data' })
}

// 修改Banner
export const updateBanner = (data) => {
  return request.post({ url: '/bannerManage/editBanner', data, headersType: 'multipart/form-data' })
}

// 删除Banner
export const deleteBanner = (id: number) => {
  return request.delete({ url: '/bannerManage/deleteBanner?id=' + id })
}

// 查询Service列表
export const getServiceList = (params) => {
  return request.get({ url: '/serviceManage/formList', params })
}

// 获取Service详情
export const getService = (id: number) => {
  return request.get({ url: '/serviceManage/getServiceById?id=' + id })
}

// 新增Service
export const createService = (data) => {
  return request.post({ url: '/serviceManage/addService', data, headersType: 'multipart/form-data' })
}

// 修改Service
export const updateService = (data) => {
  return request.post({ url: '/serviceManage/editService', data, headersType: 'multipart/form-data' })
}

// 删除Service
export const deleteService = (id: number) => {
  return request.delete({ url: '/serviceManage/deleteService?id=' + id })
}

// 查询Solution列表
export const getSolutionList = (params) => {
  return request.get({ url: '/solutionManage/formList', params })
}

// 获取Solution详情
export const getSolution = (id: number) => {
  return request.get({ url: '/solutionManage/getSolutionById?id=' + id })
}

// 新增Service
export const createSolution = (data) => {
  return request.post({ url: '/solutionManage/addSolution', data, headersType: 'multipart/form-data' })
}

// 修改Service
export const updateSolution = (data) => {
  return request.post({ url: '/solutionManage/editSolution', data, headersType: 'multipart/form-data' })
}

// 删除Service
export const deleteSolution = (id: number) => {
  return request.delete({ url: '/solutionManage/deleteSolution?id=' + id })
}

// 发布
export const release = () => {
  return request.get({ url: '/solutionManage/release' })
}